package com.hh.controller;


import com.hh.commonutils.Result;
import com.hh.entity.StatisticsDaily;
import com.hh.service.StatisticsDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author huhuan
 * @since 2022-02-23
 */
@RestController

@RequestMapping("/statistics/daily")
public class StatisticsDailyController {
    @Autowired
    private StatisticsDailyService service;

    @GetMapping("registerCount/{date}")
    public Result getRegisterCount(@PathVariable("date") String date){
        service.getRegisterCount(date);
        return Result.success();
    }

    @GetMapping("getDailtBetwenBeginAndEnd/{begin}/{end}/{type}")
    public Result getDailtBetwenBeginAndEnd(@PathVariable("begin") String begin,
                                         @PathVariable("end") String end,
                                         @PathVariable("type") String type){
        Map result = service.getDailtBetwenBeginAndEnd(begin, end, type);
        return Result.success().data(result);
    }
}

